package com.hunan.api.catv.action.cps;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.annotation.MemberAuth;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.service.biz.cps.CpsBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


@RestController
@RequestMapping(Api.cps)
@Validated
public class CpsAction extends BaseAction {

    @Autowired
    CpsBiz cpsBiz;

    @MemberAuth
    @GetMapping("/customer-info")
    public Result customerInfo(HttpServletRequest request) {
        return buildServiceResult(cpsBiz.getCustomerProductInfo(getMemberId(request)));
    }

    @MemberAuth
    @GetMapping("/payment-info")
    public Result paymentInfo(HttpServletRequest request) {
        return buildServiceResult(cpsBiz.queryPaymentInfo(getMemberId(request)));
    }
}
